﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<SubForum.ObjectModel.Posts.DiscussionPost>" %>

<asp:Content ID="loginTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Log On
</asp:Content>

<asp:Content ID="loginContent" ContentPlaceHolderID="MainContent" runat="server">
 
 <div id="discussionItem">
    <h4>Posted By: <%=Html.Encode(Model.PostedBy == null ? string.Empty : Model.PostedBy.UserName)%></h4> 

    <p id="postedOn"> 
       <%=Html.Encode( base.Model.PostDate.ToString("g") )%>
    </p>   

    <ul id="navlist">
       <li><%=Html.ActionLink("Delete","DeletePost")%></li>                
       <li><%=base.Model.Votes%> Votes</li>
       <li><%=base.Model.Views%> Views</li>
       <li><%=base.Model.Replies%> Replies</li>
       <li><%=Html.ActionLink("Link", base.Model.GetShortIdURL( "Post" )) %></li>
    </ul>

    <p id="postTitle">
        <%=Html.Encode(Model.TitleText)%>
    </p>

    <div id="postTags">
        <h4>Tags:</h4>
        <ul><% foreach (SubForum.ObjectModel.Tags.Tag tag in Model.Tags) {%>
            <li><%=Html.Encode(tag.TagName) %></li><%} %>
        </ul>
    </div><!-- end postTags -->

    <div id="postBody">
        <%=Model.BodyText%>
    </div>
</div>

<h4 id="lblReplies">Replies</h4>
<%foreach (var post in Model.Threads) {%>    
    <% Html.RenderPartial("PostPartialView", post); %>
<%}%>
   
<%  
    Html.RenderPartial("PostMessage", new SubForum.ObjectModel.Posts.DiscussionPost()
    {
        PostId = base.Model.PostId,
        RootPost = base.Model,
        BodyText = base.Model.BodyText,
        TagsText = base.Model.TagsText,
        TitleText = base.Model.TitleText
    });
%>

</asp:content>
